<?
//echo '<pre>';
//print_r( $arResult );
//echo '</pre>';

$ar_res = CCatalogProduct::GetByID($arResult["ID"]);
?>

<div id="product-detailed-block" data-quantity="<?php echo intval($ar_res['QUANTITY']); ?>"
     data-price="<?php echo intval(CPrice::GetBasePrice($arResult["ID"])["PRICE"]); ?>" class="product-block">
    <!--<a class="fancybox-thumb" rel="fancybox-thumb"
       href="<?/*= ProcessProductImage($arResult["DETAIL_PICTURE"]["SRC"], 500) */?>" title="<?/*= $arResult["NAME"] */?>">-->
    <a href="<?= $arResult["DETAIL_PAGE_URL"] ?>" title="<?= $arResult["NAME"] ?>">
        <img class="image" src="<?= ProcessProductImage($arResult["DETAIL_PICTURE"]["SRC"], 250, false) ?>" width="249"
             alt="<?= $arResult["NAME"] ?>" title="<?= $arResult["NAME"] ?>"/>
    </a>
    <? if (count($arResult["MORE_PHOTO"]) > 0): ?>
        <a name="more_photo"></a>
        <? foreach ($arResult["MORE_PHOTO"] as $PHOTO): ?>
            <a class="fancybox-thumb" rel="fancybox-thumb" href="<?= ProcessProductImage($PHOTO["SRC"], 500) ?>"
               title="<?= $arResult["NAME"] ?>">
                <img style="display: none;" border="0" src="<?= ProcessProductImage($PHOTO["SRC"], 50, false) ?>"
                     alt="<?= $arResult["NAME"] ?>" title="<?= $arResult["NAME"] ?>"/>
            </a>
        <? endforeach ?>
    <? endif ?>
    <div class="info">
        <form action="" method="post" enctype="multipart/form-data">
            <?php if (intval(CPrice::GetBasePrice($arResult["ID"])["PRICE"]) > 0) { ?>
                <span class="price"><strong>Цена:</strong> <span><?= CPrice::GetBasePrice($arResult["ID"])["PRICE"] ?></span> руб</span>
                <br/>
            <?php } ?>
            <?php if (!empty($arResult['PROPERTIES']['MANUFACTURER']['VALUE'])) { ?>
                <span class="manufacturer"><strong>Производитель: </strong>
                <br/><?= $arResult['PROPERTIES']['MANUFACTURER']['VALUE'] ?>
            </span><br/>
            <?php } ?>
            <? if (!empty($ar_res['QUANTITY'])): ?>
                <span class="count"><strong>Количество: </strong>
                    <input type="text"
                           name="<? echo $arParams["PRODUCT_QUANTITY_VARIABLE"] ?>"
                           class="text-hint" value="1"></span><br/>
            <? endif; ?>
            <?php if (!empty($arResult['PROPERTIES']['WARRANTY']['VALUE'])) { ?>
                <span class="warranty"><strong>Гарантия: </strong> <?= $arResult['PROPERTIES']['WARRANTY']['VALUE'] ?>
                    мес.</span><br/>
            <?php } ?>
            <span class="rating">
                 <?
                 $APPLICATION->IncludeComponent(
                     "bitrix:iblock.vote",
                     "ajax",
                     Array(
                         "IBLOCK_TYPE" => "catalog",
                         "IBLOCK_ID" => "3",
                         "ELEMENT_ID" => $arResult['ID'],
                         "MAX_VOTE" => "5",
                         "VOTE_NAMES" => array("0", "1", "2", "3", "4"),
                         "DISPLAY_AS_RATING" => "vote_avg",
                         "CACHE_TYPE" => $arParams["CACHE_TYPE"],
                         "CACHE_TIME" => $arParams["CACHE_TIME"],
                     )
                 );?>
            </span>
            <input type="hidden" value="BUY" name="action">
            <input type="hidden" name="<? echo $arParams["PRODUCT_ID_VARIABLE"] ?>" value="<? echo $arResult["ID"] ?>">
            <? if (!empty($ar_res['QUANTITY'])): ?>
                <span class="available">Есть в наличии</span><br/>
                <input class="cart-button" type="submit" name="<? echo $arParams["ACTION_VARIABLE"] . "ADD2BASKET" ?>"
                       value="В корзину"/>
            <? else: ?>
<!--                <span>Нет в наличии</span><br/>-->
                <span>Под заказ</span><br/>
            <?endif; ?>
        </form>

    </div>
    <br class="clear"/>
    <br/>

    <div>
        <div>
            <span class="review-title">Описание</span> <br/><br/>
            <?= $arResult['DETAIL_TEXT'] ?>
        </div>
        <br/><br/>

        <div>
            <span class="review-title">Технические характеристики</span> <br/><br/>
            <?= $arResult['PROPERTIES']['TECH_CHARACTERISTICS']['~VALUE']['TEXT'] ?>
        </div>
    </div>

    <!--<div id="product-description-block">
        <ul>
            <li class="descr"><a href="#tab-description">Описание</a></li>
            <li class="tech-chars"><a href="#tab-characteristics">Технические характеристики</a></li>
            <li class="feedback"><a href="#tab-reviews">Отзывы</a></li>
        </ul>
        <div id="tab-description" class="tab-content">
            <?/*=$arResult['DETAIL_TEXT']*/?>
        </div>
        <div id="tab-characteristics" class="tab-content">
            <?/*=$arResult['PROPERTIES']['TECH_CHARACTERISTICS']['~VALUE']['TEXT']*/?>
        </div>
        <div id="tab-reviews" class="tab-content">
              <?/*$APPLICATION->IncludeComponent("bitrix:forum.topic.reviews","",Array(
                  "SHOW_LINK_TO_FORUM" => "Y",
                  "FILES_COUNT" => "2",
                  "FORUM_ID" => "1",
                  "IBLOCK_TYPE" => "catalog",
                  "IBLOCK_ID" => "3",
                  "ELEMENT_ID" => $arResult['ID'],
                  "AJAX_POST" => "N",
                  "POST_FIRST_MESSAGE" => "Y",
                  "POST_FIRST_MESSAGE_TEMPLATE" => "#IMAGE#[url=#LINK#]#TITLE#[/url]#BODY#",
                  "URL_TEMPLATES_READ" => "read.php?FID=#FID#&TID=#TID#",
                  "URL_TEMPLATES_DETAIL" => "photo_detail.php?ID=#ELEMENT_ID#",
                  "URL_TEMPLATES_PROFILE_VIEW" => "profile_view.php?UID=#UID#",
                  "MESSAGES_PER_PAGE" => "10",
                  "PAGE_NAVIGATION_TEMPLATE" => "",
                  "DATE_TIME_FORMAT" => "d.m.Y H:i:s",
                  "PATH_TO_SMILE" => "/bitrix/images/forum/smile/",
                  "EDITOR_CODE_DEFAULT" => "Y",
                  "SHOW_AVATAR" => "Y",
                  "SHOW_RATING" => "Y",
                  "RATING_TYPE" => "like",
                  "SHOW_MINIMIZED" => "Y",
                  "USE_CAPTCHA" => "Y",
                  "PREORDER" => "Y",
                  "CACHE_TYPE" => "A",
                  "CACHE_TIME" => "0"
              )
            );*/?>
          <a class="product_feedback" href="/reviews/?product_id=<?/*=$arResult['ID'];*/?>">Оставить отзыв</a>
        </div>
    </div>-->
</div>